<html>
<head>
<title>
Netlab Reference Manual gmmem
</title>
</head>
<body>
<H1> gmmem
</H1>
<h2>
Purpose
</h2>
EM algorithm for Gaussian mixture model.

<p><h2>
Synopsis
</h2>
<PRE>

[mix, options, errlog] = gmmem(mix, x, options)
</PRE>


<p><h2>
Description
</h2>
<CODE>[mix, options, errlog] = gmmem(mix, x, options)</CODE> uses the Expectation
Maximization algorithm of Dempster et al. to estimate the parameters of
a Gaussian mixture model defined by a data structure <CODE>mix</CODE>.
The matrix <CODE>x</CODE> represents the data whose expectation
is maximized, with each row corresponding to a vector.
  
The optional parameters have the following interpretations.

<p><CODE>options(1)</CODE> is set to 1 to display error values; also logs error 
values in the return argument <CODE>errlog</CODE>.
If <CODE>options(1)</CODE> is set to 0,
then only warning messages are displayed.  If <CODE>options(1)</CODE> is -1,
then nothing is displayed.

<p><CODE>options(3)</CODE> is a measure of the absolute precision required of the error
function at the solution. If the change in log likelihood between two steps of
the EM algorithm is less than this value, then the function terminates.

<p><CODE>options(5)</CODE> is set to 1 if a covariance matrix is reset to its
original value when any of its singular values are too small (less
than MIN_COVAR which has the value eps).  
With the default value of 0 no action is taken.

<p><CODE>options(14)</CODE> is the maximum number of iterations; default 100.

<p>The optional return value <CODE>options</CODE> contains the final error value 
(i.e. data log likelihood) in
<CODE>options(8)</CODE>.  

<p><h2>
Examples
</h2>
The following code fragment sets up a Gaussian mixture model, initialises
the parameters from the data, sets the options and trains the model.
<PRE>

mix = gmm(inputdim, ncentres, 'full');

<p>options = foptions;
options(14) = 5;
mix = gmminit(mix, data, options);

<p>options(1)  = 1;		% Prints out error values.
options(14) = 30;		% Max. number of iterations.

<p>mix = gmmem(mix, data, options);
</PRE>


<p><h2>
See Also
</h2>
<CODE><a href="gmm.htm">gmm</a></CODE>, <CODE><a href="gmminit.htm">gmminit</a></CODE><hr>
<b>Pages:</b>
<a href="index.htm">Index</a>
<hr>
<p>Copyright (c) Ian T Nabney (1996-9)


</body>
</html>